
// 默认状态
let defaultState = {
  count: 0
}
// reducers
export default function reducers(state = defaultState, action) {
  console.log(action)
  switch(action.type) {
    case 'add':
      return {
        ...state,
        count: state.count+action.val,
        
      }
    default:
      return state
  }
}